﻿Imports System.Collections.ObjectModel

Public Class Compressor
    Private _Name As String
    Private _Executable As String
    Private _BannedTypes As List(Of String)
    Private _ProcessingParameters As New List(Of ProcessingParameters)

    Public ReadOnly Property Name As String
        Get
            Return _Name
        End Get
    End Property

    Public ReadOnly Property Executable As String
        Get
            Return _Executable
        End Get
    End Property

    Public ReadOnly Property Parameters As ReadOnlyCollection(Of ProcessingParameters)
        Get
            Return _ProcessingParameters.AsReadOnly
        End Get
    End Property

    Public Sub banType(ByVal type As String)
        _BannedTypes.Add(type)
    End Sub

    Public Sub banTypesfromList(ByVal types As List(Of String))
        For Each type As String In types
            _BannedTypes.Add(type)
        Next
    End Sub

    Public Sub addProcessingParameters(ByVal parameters As String, ByVal outputFileName As String)
        Dim newProcessingParameters As New ProcessingParameters(parameters, outputFileName)
        _ProcessingParameters.Add(newProcessingParameters)
    End Sub

    Public Sub addProcessingParametersfromList(ByVal processingParameters As List(Of ProcessingParameters))
        For Each processingParameter As ProcessingParameters In processingParameters
            _ProcessingParameters.Add(processingParameter)
        Next
    End Sub

    Public Sub New(ByVal name As String, ByVal executable As String)
        _Name = name
        If My.Computer.FileSystem.FileExists(executable) Then
            _Executable = executable
        Else
            MsgBox("Executable " & executable & " for " & name & " compressor was not founded!")
        End If
    End Sub
End Class
